﻿<%@ Page Language="C#" AutoEventWireup="true"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%
    string sql = "";
    db.DbHelper dbx = new db.DbHelper();

    sql = "insert into [faGui] ([fgName],[fgType],lingNum,buNum,[fgIssueBy],[fgIssueDate],[fgUploadBy],[fgUploadDate],[fgUrl]) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}')";
    //string lingNum, buNum;
    //if (int.Parse(Request["lingNum"].ToString())==0)
    //{
    //    lingNum = null;
    //} 
    //else
    //{
    //    lingNum = Request["lingNum"].ToString();
    //}


    
    sql = string.Format(sql, Request["fgName"], Request["fgType"], Request["lingNum"], Request["buNum"], Request["fgIssueBy"], Request["fgIssueDate"], null, Request["fgUploadDate"], Request["fgUrl"]);

    if (dbx.RunNoQuery(sql) > 0)
    {
        Response.Write("<script>alert('保存成功！');window.parent.$('#dlgadd').dialog('close');window.parent.location.reload();</script>");
    }
    else
    {
        Response.Write("<script>alert('保存失败！相关SQL语句如下：\\n" + sql + "');</script>");
    }    
%>
